package com.scz.controller;


import com.scz.common.lang.Result;
import com.scz.common.lang.ResultInfo;
import com.scz.entity.*;
import com.scz.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author scz
 * @since 2024-06-23
 */
@RestController
@RequestMapping("/visual")
public class VisualController {
    @Autowired
    AdsCollectService adsCollectService;

    @Autowired
    AdsItemsortService adsItemsortService;

    @Autowired
    AdsUserService adsUserService;

    @Autowired
    AdsComplainService adsComplainService;

    @Autowired
    AdsTurnoverService adsTurnoverService;

    @Autowired
    AdsNoticeService adsNoticeService;

    @Autowired
    AdsOrderService adsOrderService;

    @GetMapping("/collect")
    public Result getCollect() {
        List<AdsCollect> list = adsCollectService.list();
        return Result.success().codeAndMessage(ResultInfo.SUCCESS).data("data", list);
    }

    @GetMapping("/itemsort")
    public Result getItemSort() {
        List<AdsItemsort> list = adsItemsortService.list();
        return Result.success().codeAndMessage(ResultInfo.SUCCESS).data("data", list);
    }

    @GetMapping("/user")
    public Result getUser() {
        List<AdsUser> list = adsUserService.list();
        return Result.success().codeAndMessage(ResultInfo.SUCCESS).data("data", list);
    }

    @GetMapping("/complain")
    public Result getComplain() {
        List<AdsComplain> list = adsComplainService.list();
        return Result.success().codeAndMessage(ResultInfo.SUCCESS).data("data", list);
    }

    @GetMapping("/turnover")
    public Result getTurnover() {
        List<AdsTurnover> list = adsTurnoverService.list();
        return Result.success().codeAndMessage(ResultInfo.SUCCESS).data("data", list);
    }

    @GetMapping("/notice")
    public Result getNotice() {
        List<AdsNotice> list = adsNoticeService.list();
        return Result.success().codeAndMessage(ResultInfo.SUCCESS).data("data", list);
    }

    @GetMapping("/order")
    public Result getOrder() {
        List<AdsOrder> list = adsOrderService.list();
        return Result.success().codeAndMessage(ResultInfo.SUCCESS).data("data", list);
    }
}

